package com.vf.admin.client.dao;

import com.vf.admin.common.Constants;
import com.vf.admin.common.db.BaseDao;
import com.vf.admin.miaodong.entity.AppBanner;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

/**
 * 轮播图管理
 */
@Repository
public class AppBannerDao extends BaseDao<AppBanner> {

    /**
     * 根据轮播图位置查询列表
     */
    public List<AppBanner> clientList(Integer state) {
        ArrayList<Object> paramList = new ArrayList<Object>();
        StringBuilder sbStr = new StringBuilder("select * from app_banner where status = "+ Constants.STATE_QY +" and weizhi = ? order by sort desc ");
        paramList.add(state);
        String sql = sbStr.toString();
        return this.queryList(sql, paramList, AppBanner.class);
    }
}
